﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OutLook.Properties.Calc
{
    public class Element
    {
        #region Constructors

        /// <summary>
        /// Private empty constructor for creation Element
        /// </summary>
        private Element() : this(string.Empty, 0.0d, 0.0d, 0.0d, 0.0d, 0.0d) { }

        /// <summary>
        /// Private full constructor for creation Element
        /// </summary>
        /// <param name="name">The name of element in Mendeleev table</param>
        /// <param name="mass">The mass of element in Mendeleev table</param>
        /// <param name="ru0">The value of Ru0 for element according Prihodko theory</param>
        /// <param name="tgAlfa">The value of TgAlfa for element according Prihodko theory</param>
        /// <param name="zy">The value of Zy for element according Prihodko theory</param>
        /// <param name="d">The value of D for element according Prihodko theory</param>
        private Element(string name, double mass, double ru0, double tgAlfa, double zy, double d)
        {
            Name = name;
            Mass = mass;
            Ru0 = ru0;
            TgAlfa = tgAlfa;
            Zy = zy;
            D = d;
        }

        #endregion

        #region Factory Method

        /// <summary>
        /// Empty Element creation
        /// </summary>
        /// <returns>Element instance</returns>
        public static Element Create()
        {
            return new Element();
        }

        /// <summary>
        /// Full Element creation
        /// </summary>
        /// <param name="name">The name of element in Mendeleev table</param>
        /// <param name="mass">The mass of element in Mendeleev table</param>
        /// <param name="ru0">The value of Ru0 for element according Prihodko theory</param>
        /// <param name="tgAlfa">The value of TgAlfa for element according Prihodko theory</param>
        /// <param name="zy">The value of Zy for element according Prihodko theory</param>
        /// <param name="d">The value of D for element according Prihodko theory</param>
        public static Element Create(string name, double mass, double ru0, double tgAlfa, double zy, double d)
        {
            if (name == null || name.Length > 2 || mass == default(double))
                return null;

            return new Element(name, mass, ru0, tgAlfa, zy, d);
        }
        #endregion

        #region Properties

        /// <summary>
        /// The name of element in Mendeleev table
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// The mass of element in Mendeleev table
        /// </summary>
        public double Mass { get; set; }

        /// <summary>
        /// The value of Ru0 for element according Prihodko theory
        /// </summary>
        public double Ru0 { get; set; }

        /// <summary>
        /// The value of TgAlfa for element according Prihodko theory
        /// </summary>
        public double TgAlfa { get; set; }

        /// <summary>
        /// The value of Zy for element according Prihodko theory
        /// </summary>
        public double Zy { get; set; }

        /// <summary>
        /// The value of D for element according Prihodko theory
        /// </summary>
        public double D { get; set; }

        #endregion

    }
}
